﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Infrastructure.ViewModels;

namespace UI.Dialogs
{
    /// <summary>
    /// Interaction logic for PublisherDictionary.xaml
    /// </summary>
    public partial class PublisherDictionary : Window
    {
        AllCompaniesViewModel _allCompaniesVM;

        public PublisherDictionary()
        {
            InitializeComponent();

            _allCompaniesVM = new AllCompaniesViewModel();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Publishers.ItemsSource = _allCompaniesVM.Companies;
            AddPub.Command = AddPublisher.Save;
            EditPub.Command = EditPublisher.Save;
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            
        }

        private void Publishers_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            EditPublisher.DataContext = Publishers.SelectedItem as CompanyViewModel;
        }
    }
}
